import axios from "axios";


const RoleStory ={
    namespaced: true,
    state:()=>({
        Role_list:[]
    }),
    mutations:{
        RoleMutations(state,old){
            state.Role_list =old
        }
    },
    actions:{
        RoleActions(conetxt){
            axios.get('/rolelist').then(
                res=>{
                   
                    if(res.code == 403){
                        localStorage.removeItem('log_list')
                        window.location.href = "/#/login"
                       
                    }else{
                        conetxt.commit('RoleMutations',res.list)
                    }
                }
            )
        }

    }
}
export default RoleStory